//
// CCameraCol.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CCameraCol {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CCameraCol(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CCameraCol obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CCameraCol(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CCameraCol() {
    this(nel3dJNI.new_CCameraCol(), true);
  }

  public void build(CVector start, CVector end, float radius, boolean cone) {
    nel3dJNI.CCameraCol_build(swigCPtr, this, CVector.getCPtr(start), start, CVector.getCPtr(end), end, radius, cone);
  }

  public void buildRay(CVector start, CVector end) {
    nel3dJNI.CCameraCol_buildRay(swigCPtr, this, CVector.getCPtr(start), start, CVector.getCPtr(end), end);
  }

  public void minimizeDistanceAgainstTri(CVector p0, CVector p1, CVector p2, SWIGTYPE_p_float sqrMinDist) {
    nel3dJNI.CCameraCol_minimizeDistanceAgainstTri(swigCPtr, this, CVector.getCPtr(p0), p0, CVector.getCPtr(p1), p1, CVector.getCPtr(p2), p2, SWIGTYPE_p_float.getCPtr(sqrMinDist));
  }

  public void setApplyMatrix(CCameraCol other, SWIGTYPE_p_NLMISC__CMatrix matrix) {
    nel3dJNI.CCameraCol_setApplyMatrix(swigCPtr, this, CCameraCol.getCPtr(other), other, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(matrix));
  }

  public SWIGTYPE_p_NLMISC__CAABBox getBBox() {
    return new SWIGTYPE_p_NLMISC__CAABBox(nel3dJNI.CCameraCol_getBBox(swigCPtr, this), false);
  }

  public float getRayLen() {
    return nel3dJNI.CCameraCol_getRayLen(swigCPtr, this);
  }

  public boolean isSimpleRay() {
    return nel3dJNI.CCameraCol_isSimpleRay(swigCPtr, this);
  }

}
